#{extends 'main.html' /}
#{set title:'Fiche' /}

<div id="sheetContainer" class="form">
	
	<button id="cmd_update" class="ui-button ui-widget ui-state-default ui-corner-all ui-button-text-only">Modifier</button>
	
	<p>
    	<label class="small">&nbsp;</label>
    	<span class="small bigtitle">${sheet.book.title}</span>
    	#{if sheet.book.collection != null}
        	<label class="small">Série : </label>
        	<span class="small">${sheet.book.collection.title}</span>
    	#{/if}
    </p>
    <p>
    	<label class="small">Auteur : </label>
    	<span class="small">
    		<a href="@{author.displaylist(sheet.book.author.id)}">
    			${sheet.book.author.name} ${sheet.book.author.firstname}
    		</a>
    	</span>
    	<label class="small">Note : </label>
    	<span class="starcontainer small">
    		#{list items:1..5, as:'i'}
    			#{if sheet.grade < i}
    				<img src="@{'public/images/star1-little.gif'}" />
    			#{/if}
    			#{else}
    				<img src="@{'public/images/star2-little.gif'}" />
    			#{/else}
    		#{/list}
    	</span>
    </p>
    <p>
    	<label class="small">Origine : </label>
    	<span class="small">${sheet.origin}</span>
    	<label class="small">Date de lecture : </label>
    	<span class="small">
    		#{if sheet.readingdate != null}
    		${sheet.readingdate.format('MMMMM yyyy')}
    		#{/if}
    	</span>
    </p>
	
	<hr class="space" />
	
	<p>
    	<label class="small">Le début : </label>
    	<span class="medium">${sheet.beginning?.raw()}</span>
    </p>
	<p>
    	<label class="small">Résumé : </label>
    	<span class="medium">${sheet.resume?.raw()}</span>
    </p>
    <p>
    	<label class="small">Extrait : (${sheet.piecePage})</label>
    	<span class="medium">${sheet.piece?.raw()}</span>
    </p>
    <p>
    	<label class="small">Commentaire personnel : </label>
    	<span class="medium">${sheet.comment?.raw()}</span> *{ .raw() --> escape=false }*
    </p>

    #{if covers}
		<p>
		#{list items:covers, as:'cover'}
			<img src="@{'public/images/cover/'}/${cover.path}" />
		#{/list}
		</p>
	#{/if}

    
</div>

<script language="javascript" type="text/javascript">
$(document).ready(function(){

	$("#cmd_update").click(function() {
		window.location = '@{readingsheetmngt.updateform(sheet.id)}'
	});

});
</script>    
	    
	    